<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>正则的exec方法</title>
		<script>
			patt=/\d{8,11}/g;
			var result;
			str="老刘今年25岁了，手机号是13865997763,孔老师13745336662，赵吉山15190454889，刘校长62903310";
			while ((result = patt.exec(str)) != null)  {
			  document.write(result);
			  document.write("<br />");
			  document.write(patt.lastIndex);
			  document.write("<br />");
			}
			 
		</script>
	</head>
	<body>
	</body>
</html>
